<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>最新公告信息</title>
<link href="/tmx/css/common.css" rel="stylesheet" />
<script type="text/javascript" src="/tmx/js/jquery-1.8.1.min.js"></script>
<script charset="utf-8" src="/tmx/js/kindeditor-4.1.10/kindeditor.js"></script>
<script charset="utf-8" src="/tmx/js/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script type="text/javascript" charset="utf-8" src="/tmx/js/myJs2.js"></script>
<script type="text/javascript">
function updateNotice(){
	var title = $.trim($('#title').val());
	editor6.sync();
	var content = $.trim($('#content').val());
	if(title==""){
		alert("标题不能为空");
		return;
	}
	if(content==""){
		alert("内容不能为空");
		return;
	}
	var timeKey = $('#timeKey').val();
	$.post(
	"/tmx/NoticeAction!updateNotice.action",
	{
		"notice.title":title,
		"notice.content":content,
		"notice.timeKey":timeKey
	},
	function(data){
		alert(data.message);
		if(data.success){
			location.href="/tmx/NoticeAction!getNoticeListForPage.action";
		}
	},
	"json"
	)
}
function resetNotice(timeKey){
	var timeKey = $('#timeKey').val();
	location.href="/tmx/NoticeAction!toEditNotice.action?notice.timeKey="+timeKey;
}
function FanHui(){
	location.href="/tmx/NoticeAction!getNoticeListForPage.action";
}

</script>
</head>
<body>
<div class="content">
  <div class="contentTitle">
    <div class="titImg"></div>
    公告编辑<a style="float: right;font-size: 15px;margin-right: 5px;" href="javascript:void(0)" onclick="FanHui()">&lt;&lt;返回</a></div>
  <table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding:10px;">
    <tr>
      <td  class="column4_1 h30" style="text-align:right">标题：</td>
      <td  class="column4_3 h30 align" colspan="3"><input type="text" class="nInput" id="title" value="${notice.title }"/></td>
    </tr>
    <tr>
      <td  class="column4_1 h30" style="text-align:right">正文:</td>
      <td  class="column4_3 align" colspan="3" style="padding: 5px;">
      <textarea class="textArea" style="width:300px;height:200px" name="content" id="content">${notice.content}</textarea></td>
    </tr>
  </table>
  <div class="allSave">
  <input type="hidden" id="timeKey" value="${notice.timeKey }"/>
  <div style="margin:0 auto;width: 250px; height: 30px;">
  	<a class="save2"  href="javascript:void(0)" onclick="updateNotice()">修改</a>
  	<a class="save2"  href="javascript:void(0)" onclick="resetNotice()">重置</a>
  	</div>
  </div>
</div>
</body>
</html>
